// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-9-15 18:54:00

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   l0.java

package com.zelix;

import java.awt.*;

// Referenced classes of package com.zelix:
//            n4, g2

public class l0
    implements LayoutManager2
{

    protected Container a;
    protected Component b;
    protected Component c;
    protected n4 d;
    protected Dimension e;
    protected int f;
    protected float g;
    protected boolean h;
    protected int i;
    private static String z[];

    public l0(int j, int k, boolean flag, int l)
    {
        super();
        boolean flag1;
label0:
        {
            flag1 = g2.b;

            f = 0;
            if(j == 0)
            {
                f = 0;
                if(!flag1)
                    break label0;
            }
            if(j == 1)
            {
                f = 1;
                if(!flag1)
                    break label0;
            }
            throw new IllegalArgumentException(z[4]);
        }
label1:
        {
            if(k >= 0 && k <= 100)
            {
                g = (float)k / 100F;
                if(!flag1)
                    break label1;
            }
            throw new IllegalArgumentException(z[3]);
        }
label2:
        {
            if(l >= 3 && l <= 7)
            {
                i = l;
                if(!flag1)
                    break label2;
            }
            throw new IllegalArgumentException(z[2]);
        }
        h = flag;
    }

    private void a(Component component)
    {
label0:
        {
            boolean flag = g2.b;
            if(b == null)
            {
                b = component;
                if(!flag)
                    break label0;
            }
            if(b != component && c == null)
            {
                c = component;
                if(!flag)
                    break label0;
            }
            if(c == component)
                throw new IllegalArgumentException(z[0]);
        }
    }

    public void addLayoutComponent(Component component, Object obj)
    {
        if(obj != this)
            a(component);
    }

    public void addLayoutComponent(String s, Component component)
    {
        a(component);
    }

    void a(Point point)
    {
label0:
        {
            if(f == 0)
            {
                g = (float)(b.getSize().width + point.x) / (float)a.getSize().width;
                if(!g2.b)
                    break label0;
            }
            g = (float)(b.getSize().height + point.y) / (float)a.getSize().height;
        }
        g = Math.max(0.0F, Math.min(1.0F, g));
        a.invalidate();
        a.validate();
    }

    void b(Point point)
    {
        a(point);
    }

    void c(Point point)
    {
        if(h)
            a(point);
    }

    private Dimension a(Container container, Insets insets)
    {
        Dimension dimension = container.getSize();
        dimension.width -= insets.left + insets.left;
        dimension.height -= insets.top + insets.bottom;
        if(e != null)
        {
            int j = Math.max(dimension.width, e.width);
            int k = Math.max(dimension.height, e.height);
            return new Dimension(j, k);
        } else
        {
            return dimension;
        }
    }

    public float getLayoutAlignmentX(Container container)
    {
        return 0.5F;
    }

    public float getLayoutAlignmentY(Container container)
    {
        return 0.5F;
    }

    public void invalidateLayout(Container container)
    {
    }

    public void layoutContainer(Container container)
    {
label0:
        {
            if(a == null)
                a = container;
            if(d == null)
            {
                d = new n4(this);
                a.add(d, this);
            }
            Insets insets = container.getInsets();
            Dimension dimension = a(container, insets);
            if(f == 0)
            {
                int j = Math.max(0, Math.round((float)dimension.width * g - (float)i));
                int l = dimension.width - i - j;
                b.setBounds(0, 0, j, dimension.height);
                d.setBounds(j, 0, i, dimension.height);
                c.setBounds(j + i, 0, l, dimension.height);
                if(!g2.b)
                    break label0;
            }
            int k = Math.max(0, Math.round((float)dimension.height * g - (float)i));
            int i1 = dimension.height - i - k;
            b.setBounds(0, 0, dimension.width, k);
            d.setBounds(0, k, dimension.width, i);
            c.setBounds(0, k + i, dimension.width, i1);
        }
    }

    public Dimension maximumLayoutSize(Container container)
    {
        return new Dimension(0x7fffffff, 0x7fffffff);
    }

    public Dimension minimumLayoutSize(Container container)
    {
        return preferredLayoutSize(container);
    }

    public Dimension preferredLayoutSize(Container container)
    {
        if(e != null)
            return e;
        else
            return new Dimension(100, 100);
    }

    public void removeLayoutComponent(Component component)
    {
label0:
        {
            boolean flag = g2.b;
            if(b == component)
            {
                b = null;
                if(!flag)
                    break label0;
            }
            if(c == component)
            {
                c = null;
                if(!flag)
                    break label0;
            }
            throw new IllegalArgumentException(z[1]);
        }
    }

    private static String z(char ac[]) {
        for (int i = 0; i < ac.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key =0x29;
                    break;
                case 1:
                    key =69;
                    break;
                case 2:
                    key =125;
                    break;
                case 3:
                    key =76;
                    break;
                default:
                    key =119;
                    break;
            }
            ac[i] ^= key;
        }
        return new String(ac).intern();
    }

    static 
    {
        String as[];
        as = new String[5];
        as[0] = "z5\021%\003e$\004#\002]e8>\005F7]aWd*\017)W]-\034\"W]2\022l4F(\r#\031L+\t?WH!\031)\023";
        as[1] = "z5\021%\003e$\004#\002]e8>\005F7]aW|+\026\"\030^+]\017\030D5\022\"\022G1";
        as[2] = "m,\013%\023L7]8\037@&\026\"\022Z6]!\002Z1].\022\t{@lD\tc[lK\024eJ";
        as[3] = "`+\0248\036H)]?\007E,\tl\007L7\036)\031]$\032)WD0\0168WK ]rJ\tu]jQ\ty@lF\031u";
        as[4] = "z5\021%\003\t1\004<\022\t(\b?\003\t'\030l$Y)\0248;H<\0229\003\007\0238\036#`\006<\000WF7]\037\007E,\t\000\026P*\b8Ya\n/\005-f\013)\r;";
        for (int i = 0; i < as.length; i++) {
            as[i] = z(as[i].toCharArray());
        }
        z = as;

    }
}